Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickTime Components /
Chapter 4 - Image Compressor Components / Image Compressor Components Reference
Functions / Direct Functions


CDGetCompressionTime

Your component receives the CDGetCompressionTime request whenever an application calls the Image Compression Manager's GetCompressionTime function.

pascal ComponentResult CDGetCompressionTime (PixMapHandle src, 
                                          const Rect *srcRect,
                                          short depth, CodecQ 
                                          *spatialQuality, 
                                          CodecQ *temporalQuality,
                                          unsigned long *time);
src
Contains a handle to the source image. The source image is stored in a pixel map. Applications may use the time information you return for more than one image. Consequently, your compressor should not consider the contents of the image when determining the maximum compression time. Rather, you should consider only the quality level, pixel depth, and image size.
This parameter may be set to nil. In this case the application has not supplied a source image--your component should use the other parameters to determine the characteristics of the image to be compressed.
srcRect
Contains a pointer to a rectangle defining the portion of the source image to compress.
depth
Specifies the depth at which the image is to be compressed. Values of 1, 2, 4, 8, 16, 24, and 32 indicate the number of bits per pixel for color images. Values of 33, 34, 36, and 40 indicate 1-bit, 2-bit, 4-bit, and 8-bit grayscale, respectively, for grayscale images.
spatialQuality
Contains a pointer to a field containing the desired compressed image quality. The compressor sets this field to the closest actual quality that it can achieve. See the chapter "Image Compression Manager" in Inside Macintosh: QuickTime for valid values. Check to see if the value of this field is nil and, if so, do not write to location 0.
temporalQuality
Contains a pointer to a field containing the desired sequence temporal quality. The compressor sets this field to the closest actual quality that it can achieve. See the chapter "Image Compression Manager" in Inside Macintosh: QuickTime for valid values. Check to see if the value of this field is nil and, if so, do not write to location 0.
time
Contains a pointer to a field to receive the compression time, in milliseconds. If your component cannot determine the amount of time required to compress the image, set this field to 0. Check to see if the value of this field is nil and, if so, do not write to location 0.
DESCRIPTION
Your component returns a long integer indicating the maximum number of milliseconds it would require to compress the specified image.

Only compressors receive this request.
RESULT CODES
noErr0No error
paramErr-50Invalid parameter specified
codecUnimpError-8962Feature not implemented by this compressor

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help